// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   fileDivider.java

package include.text_manage;

import java.io.*;

// Referenced classes of package include.text_manage:
//			getCurrentTime

public class fileDivider
{

	public fileDivider()
	{
	}

	public String[] fileDivider(String filename, String files[])
	{
		String result[] = files;
		String time = (new getCurrentTime()).getCurrentTime();
		String s = new String();
		int i = 0;
		try
		{
			BufferedReader in = new BufferedReader(new FileReader(filename));
			BufferedWriter oout = new BufferedWriter(new FileWriter((new StringBuilder(String.valueOf(files[0]))).append("-").append(time).append(".txt").toString()));
			while ((s = in.readLine()) != null) 
				if (!s.equals("~"))
				{
					oout.write(s);
					oout.newLine();
				} else
				{
					oout.flush();
					oout.close();
					i++;
					result[i] = (new StringBuilder(String.valueOf(files[i]))).append("-").append(time).append(".txt").toString();
					oout = new BufferedWriter(new FileWriter(result[i]));
				}
			result[0] = (new StringBuilder(String.valueOf(files[0]))).append("-").append(time).append(".txt").toString();
			oout.flush();
			oout.close();
		}
		catch (FileNotFoundException filenotfoundexception) { }
		catch (IOException ioexception) { }
		return result;
	}
}
